//
//  FMRecommendCollectionViewCell.m
//  PsychologyFM
//
//  Created by lanou on 16/1/12.
//  Copyright © 2016年 ZhangLuDu. All rights reserved.
//

#import "FMRecommendCollectionViewCell.h"
#import <UIImageView+WebCache.h>


@implementation FMRecommendCollectionViewCell

- (instancetype)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self) {
        

        
        _imageView = [[UIImageView alloc]initWithFrame:CGRectMake(0, 0, (kScreenWidth - 40) / 3, (kScreenWidth - 40) / 3)];
        _imageView.backgroundColor = FMGray;
        [self.contentView addSubview:_imageView];
        
        _titleLabel = [[UILabel alloc]initWithFrame:CGRectMake(0, _imageView.bottom + 5, (kScreenWidth - 40) / 3, 40)];
        _titleLabel.numberOfLines = -1;
        _titleLabel.textColor = FMGray;
        _titleLabel.font = [UIFont systemFontOfSize:14];
//        _titleLabel.backgroundColor = FMCyan;
        [self.contentView addSubview:_titleLabel];
    }
    return self;
}


- (void)setModel:(FMLessonAndFMModel *)model
{
    _model = model;
    [_imageView sd_setImageWithURL:[NSURL URLWithString:model.cover] placeholderImage:nil completed:nil];
    _titleLabel.text = model.title;
}

@end
